package com.manpower.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * MpPosition entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "mp_position", catalog = "manpower")
public class MpPosition implements java.io.Serializable {

	// Fields

	private String id;
	private MpDept mpDept;
	private String positionDisplayId;
	private String positionName;
	private Integer positionType;
	private String positionDescription;
	private String positionRemarks;
	private Integer positionActivation;
	private Set<MpRecruitment> mpRecruitments = new HashSet<MpRecruitment>(0);
	private Set<MpRenshi> mpRenshis = new HashSet<MpRenshi>(0);
	private Set<MpResume> mpResumes = new HashSet<MpResume>(0);

	// Constructors

	/** default constructor */
	public MpPosition() {
	}

	/** minimal constructor */
	public MpPosition(String id) {
		this.id = id;
	}

	/** full constructor */
	public MpPosition(String id, MpDept mpDept, String positionDisplayId,
			String positionName, Integer positionType,
			String positionDescription, String positionRemarks,
			Integer positionActivation, Set<MpRecruitment> mpRecruitments,
			Set<MpRenshi> mpRenshis, Set<MpResume> mpResumes) {
		this.id = id;
		this.mpDept = mpDept;
		this.positionDisplayId = positionDisplayId;
		this.positionName = positionName;
		this.positionType = positionType;
		this.positionDescription = positionDescription;
		this.positionRemarks = positionRemarks;
		this.positionActivation = positionActivation;
		this.mpRecruitments = mpRecruitments;
		this.mpRenshis = mpRenshis;
		this.mpResumes = mpResumes;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "position_dept")
	public MpDept getMpDept() {
		return this.mpDept;
	}

	public void setMpDept(MpDept mpDept) {
		this.mpDept = mpDept;
	}

	@Column(name = "position_display_id", length = 200)
	public String getPositionDisplayId() {
		return this.positionDisplayId;
	}

	public void setPositionDisplayId(String positionDisplayId) {
		this.positionDisplayId = positionDisplayId;
	}

	@Column(name = "position_name", length = 200)
	public String getPositionName() {
		return this.positionName;
	}

	public void setPositionName(String positionName) {
		this.positionName = positionName;
	}

	@Column(name = "position_type")
	public Integer getPositionType() {
		return this.positionType;
	}

	public void setPositionType(Integer positionType) {
		this.positionType = positionType;
	}

	@Column(name = "position_description", length = 200)
	public String getPositionDescription() {
		return this.positionDescription;
	}

	public void setPositionDescription(String positionDescription) {
		this.positionDescription = positionDescription;
	}

	@Column(name = "position_remarks", length = 200)
	public String getPositionRemarks() {
		return this.positionRemarks;
	}

	public void setPositionRemarks(String positionRemarks) {
		this.positionRemarks = positionRemarks;
	}

	@Column(name = "position_activation")
	public Integer getPositionActivation() {
		return this.positionActivation;
	}

	public void setPositionActivation(Integer positionActivation) {
		this.positionActivation = positionActivation;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpPosition")
	public Set<MpRecruitment> getMpRecruitments() {
		return this.mpRecruitments;
	}

	public void setMpRecruitments(Set<MpRecruitment> mpRecruitments) {
		this.mpRecruitments = mpRecruitments;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpPosition")
	public Set<MpRenshi> getMpRenshis() {
		return this.mpRenshis;
	}

	public void setMpRenshis(Set<MpRenshi> mpRenshis) {
		this.mpRenshis = mpRenshis;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpPosition")
	public Set<MpResume> getMpResumes() {
		return this.mpResumes;
	}

	public void setMpResumes(Set<MpResume> mpResumes) {
		this.mpResumes = mpResumes;
	}

}